import { ReactElement } from 'react'
import { Navigate } from 'react-router-dom'
import { isToken } from '../../utils/auth'
// Navigate,
type Props = {
  children: ReactElement
}
function Auth({ children }: Props) {
  return isToken() ? children : <Navigate to={'/login'} replace={true} />
}

export default Auth
